# 如果括号内不填，则默认继承 object
class Parson():
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def ff(self):
        print(self.name, self.age)


# 继承 Parson 父类
class Student(Parson):
    def __init__(self, name, age, stu_no):
        # 新增一个只属于 Student 的 stu_no 对象
        super().__init__(name, age)
        self.stu_on = stu_no

    def ff(self):
        # 调用父类 Parson 的 ff 方法并且重写它
        super().ff()
        print('“教龄”：', stu.stu_on)


# 继承 Parson 父类
class Teacher(Parson):
    def __init__(self, name, age, taechofyear):
        super().__init__(name, age)
        self.taechofyear = taechofyear

    def qiannian(self):
        print(self.taechofyear)


stu = Student('阿瑾', 20, 10012)
teacher = Teacher('阿洛', 27, '千年')

# ff 方法都是从 Parson 继承下来的
stu.ff()
print('--------------')
teacher.ff()


# 多继承


class A(object):
    pass


class B(object):
    pass


# 同时继承 A、B 两个父类
class X(A, B):
    pass
